package com.ftg.shopping.memberlogin.controller;


import com.ftg.shopping.config.LayuiPage;
import com.ftg.shopping.member.entity.sp_memberinfo;
import com.ftg.shopping.memberlogin.mapper.MemberLoginMapper;
import com.ftg.shopping.memberlogin.service.MemberLoginService;
import com.ftg.shopping.user.entity.sp_userinfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Api(description = "会员登录")
@RestController
@RequestMapping("/api/memberlogin")
public class MemberLoginController {
    @Autowired
    MemberLoginService memberLoginService;

    @ApiOperation("登录")
    @PostMapping("/login")
    public LayuiPage<sp_memberinfo> login(sp_memberinfo m){
        return memberLoginService.login(m);
    }

    @ApiOperation("注册")
    @PostMapping("/insert")
    public int savememberlogin(sp_memberinfo m){
        return memberLoginService.savememberlogin(m);

    }

}
